
import DialogComponent from './Dialog';

const Dialog = {};

Dialog.install = function (Vue) {
    const dialogContructor = Vue.extend(DialogComponent);
    const instance = new dialogContructor();
    instance.$mount(document.createElement('div'));
    document.body.appendChild(instance.$el);
    Vue.prototype.$dialog = (msg,callback) => {
        instance.msg = msg;
        instance.show();
        instance.callback = callback;
    }
}

export default Dialog;